Imaging apparatus, imaging apparatus control method, and computer program product, with eye blink detection features

ABSTRACT

An imaging apparatus includes a focus control unit that sets an image area including eyes, which is included in an input image inputted in the imaging apparatus, as a range finding area for calculation of a subject distance and acquires an evaluation value based on contrast of the range finding area to detect a focus position and a blink detecting unit that detects presence or absence of a blink on the basis of image analysis in the range finding area. The focus control unit inputs blink detection information in the blink detection unit, identifies evaluation value data in a blink period and a non-blink period, and executes processing for detecting a focus position on the basis of only an evaluation value in a period judged as the non-blink period.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.11/756,067 filed May 31, 2007 and contains subject matter related toJapanese Patent Application JP 2006-160454 filed in the Japanese PatentOffice on Jun. 9, 2006, the entire contents of both of which areincorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an imaging apparatus, an imagingapparatus control method, and a computer program. More specifically, thepresent invention relates to an imaging apparatus, an imaging apparatuscontrol method, and a computer program that make it possible to performquick and accurate auto-focus processing for a target subject andprevent, in particular, an auto-focus control error due to a blink.

2. Description of the Related Art

Recently, an auto-focus (AF) mechanism that automatically takes thefocus on a subject is mounted on many imaging apparatuses such as astill camera and a video camera. In photographing by general cameras,people are main subjects in a large number of cases. However, the peopleare present in various positions in photographed images and there arevarious compositions of the images. From the very beginning, a targetsubject may be present in a position where a range finding area in animaging apparatus is not set. To cope with such a problem, it isproposed to recognize a face from an image in an imaging apparatus andset a range finding area in a position of the recognized face to make itpossible to focus the imaging apparatus on the face regardless of acomposition. For example, a focus control technique based on such facerecognition is disclosed in JP-A-2003-107335. Focus control based onthis face recognition makes it possible to perform appropriate focuscontrol (focusing) in photographing of various compositions.

In photographing of a person, it is standard practice to target eyes forfocusing. An apparatus that specifies eyes of a person as a rangefinding area and automatically performs focusing in a camera with anarea of eyes of a subject as a reference is disclosed inJP-A-2005-128156.

As a method of focus control, a method of judging a level of contrast ofimaging data acquired via a lens is known. This is a system for settinga specific area of a photographed image as a signal acquisition area forfocus control (a spatial frequency extraction area), judging that thelens is more in focus as contrast of this specific area is higher andthat the lens is out of focus when the contrast is low, and driving thelens to a position for increasing the contrast to adjust the focus. Sucha focus control processing technique is disclosed in, for example,JP-A-10-213737.

Specifically, a method of extracting a high-frequency component of thespecific area, generating integrated data of the high-frequencycomponent extracted, and judging a level of contrast on the basis of thehigh-frequency component integrated data generated is applied to themethod of focus control. In other words, a high-frequency componentintegrated value of the specific area is calculated for judging thelevel of the contrast and used as an evaluation value (an AF evaluationvalue). Auto-focus is realized by driving a focus lens to maximize theevaluation value. To perform the auto-focus, it is necessary to drivethe lens with the evaluation value as a guideline. As a lens drivingmechanism, for example, a voice coil motor is used.

However, in the auto-focus using an image contrast signal, if an areaincluding eyes is set as the specific area to judge the level of thecontrast, the contrast substantially changes when a person blinks duringan auto-focus operation. As a result, it is difficult to performaccurate distance measurement and focus control.

The auto-focus using a contrast signal is on the premise thatfluctuation in the contrast depends on only a change of focus. However,when the person blinks, a change in the contrast signal is caused simplyby the blink. Thus, it is difficult to judge a contrast signal changedue to movement of the focus and judge a focus position where the lensis focused.

A specific example will be explained with reference to FIG. 1. (A) and(B) in FIG. 1 are diagrams of an example in which a focus lens is movedfrom a close range side to an infinite side and an evaluation valueindicating a level of contrast of a specific area including eyes of aperson is measured. In (A) in FIG. 1, the person does not blink and, in(B) in FIG. 1, the person blinks.

In auto-focus processing in the case of (A) in FIG. 1 in which theperson does not blink, fluctuation in contrast occurs depending on onlya change in focus. Accurate focus control in which a peak position of anevaluation value corresponds to a focus position is performed. On theother hand, in the case of (B) in FIG. 1 in which the person blinks, achange in an image itself including the specific area including the eyesoccurs, a change in contrast occurs on the basis of an image change dueto a blink rather than a change in focus, and a peak position of anevaluation value is different from a focus position. Thus, accuratefocus control is not performed.

SUMMARY OF THE INVENTION

Therefore, it is desirable to provide an imaging apparatus, an imagingapparatus control method, and a computer program that makes it possibleto perform quick and accurate auto-focus processing for a target subjectand prevent, in particular, a focus control error due to a blink.

Since a human blink is an involuntary movement and psychologicallyaffected, it is difficult to predict timing of the blink. Therefore, itis desirable to provide an imaging apparatus, an imaging apparatuscontrol method, and a computer program for monitoring occurrence of ablink during auto-focus control and performs processing complying withinformation of the monitoring to prevent a focus control error due to ablink.

According to an embodiment of the invention, there is provided animaging apparatus including a focus control unit that sets an image areaincluding eyes, which is included in an input image inputted in theimaging apparatus, as a range finding area for calculation of a subjectdistance and acquires an evaluation value based on contrast of the rangefinding area to detect a focus position and a blink detecting unit thatdetects presence or absence of a blink on the basis of image analysis inthe range finding area. The focus control unit inputs blink detectioninformation in the blink detection unit, identifies evaluation valuedata in a blink period and a non-blink period, and executes processingfor detecting a focus position on the basis of only an evaluation valuein a period judged as the non-blink period.

According the embodiment of the invention, the focus control unit standsby for finish of the blink when detection information indicating that aperson is blinking is inputted from the blink detecting unit before thestart of driving of a focus lens for acquisition of an evaluation valueand executes, after confirming that the blink is finished, control forstarting the driving of the focus lens for acquisition of an evaluationvalue.

According to the embodiment of the invention, the focus control unitstops, when blink detection information indicating that a person hasblinked is inputted from the blink detecting unit after the start ofdriving of a focus lens for acquisition of an evaluation value, thedriving of the focus lens to suspend the acquisition of an evaluationvalue and executes processing for returning the focus lens to a focuslens setting position before the person blinks.

According to the embodiment of the invention, the focus control unitexecutes the processing for returning the focus lens to the focus lenssetting position before a person blinks taking into account a timedifference between blink detection processing and evaluation valuecalculation processing.

According to the embodiment of the invention, the focus control unitjudges, when blink detection information indicating that a person hasblinked is inputted from the blink detecting unit after the start ofdriving of a focus lens for acquisition of an evaluation value, whethera peak of an evaluation value has been detected and, when the peak hasbeen detected, determines a focus position on the basis of the peak andfinishes focus position detection processing.

According to the embodiment of the invention, the focus control unitjudges, when blink detection information indicating that a person hasblinked is inputted from the blink detecting unit after the start ofdriving of a focus lens for acquisition of an evaluation value, whethera peak of an evaluation value has been detected and, when the peak hasnot been detected, executes, after confirming that the blink isfinished, acquisition of an evaluation value from a focus lens settingposition before the person blinks.

According to the embodiment of the invention, the imaging apparatusfurther includes a subject-distance calculating unit that calculates asubject distance on the basis of a size of a face included in the inputimage. The focus control unit executes comparison of a subject distancebased on an evaluation value corresponding to contrast and the subjectdistance calculated on the basis of the size of the face and, when thereis a difference equal to or larger than a threshold set in advancebetween both the distances, executes evaluation value acquisitionprocessing based on the contrast again.

According to the embodiment of the invention, the subject-distancecalculating unit inputs subject information of at least one of a race, asex, an age, and a physique in subject distance calculation processingbased on a size of a face detected by a face detecting unit andexecutes, on the basis of the subject information inputted, subjectdistance calculation processing to which a reference value of a size ofa face corresponding to the subject is applied.

According to the embodiment of the invention, the subject information ofat least one of the race, the sex, the age, and the physique isinformation inputted to the subject-distance calculating unit as ananalysis result in an image analyzing unit for the input image inputtedin the imaging apparatus.

According to the embodiment of the invention, the subject information ofat least one of the race, the sex, the age, and the physique isinformation inputted to the subject-distance calculating unit via a userinput unit in the imaging apparatus.

According to the embodiment of the invention, the focus control unitrepeatedly executes evaluation value acquisition processing based on thecontrast of the range finding area plural times, compares plural resultdata acquired, and, when same evaluation data are acquired, determines afocus position according to majority processing for setting theevaluation value data as proper evaluation data.

According to another embodiment of the invention, there is provided animaging apparatus control method of executing auto-focus control in animaging apparatus, the imaging apparatus control method including afocus control step of setting, in a focus control unit, an image areaincluding eyes, which is included in an input image of the imagingapparatus, as a range finding area for calculation of a subject distanceand acquiring an evaluation value based on contrast of the range findingarea to detect a focus position and a blink detecting step of detecting,in a blink detecting unit, presence or absence of a blink on the basisof image analysis in the range finding area. The focus control step is astep of inputting blink detection information in the blink detectionunit, identifying evaluation value data in a blink period and anon-blink period, and executing processing for detecting a focusposition on the basis of only an evaluation value in a period judged asthe non-blink period.

According the embodiment of the invention, the focus control stepincludes a step of standing by for finish of the blink when detectioninformation indicating that a person is blinking is inputted from theblink detecting unit before the start of driving of a focus lens foracquisition of an evaluation value and executing, after confirming thatthe blink is finished, control for starting the driving of the focuslens for acquisition of an evaluation value.

According to the embodiment of the invention, the focus control stepincludes a step of stopping, when blink detection information indicatingthat a person has blinked is inputted from the blink detecting unitafter the start of driving of a focus lens for acquisition of anevaluation value, the driving of the focus lens to suspend theacquisition of an evaluation value and executing processing forreturning the focus lens to a focus lens setting position before theperson blinks.

According to the embodiment of the invention, in the focus control step,the processing for returning the focus lens to the focus lens settingposition before a person blinks is executed taking into account a timedifference between blink detection processing and evaluation valuecalculation processing.

According to the embodiment of the invention, the focus control stepincludes a step of judging, when blink detection information indicatingthat a person has blinked is inputted from the blink detecting unitafter the start of driving of a focus lens for acquisition of anevaluation value, whether a peak of an evaluation value has beendetected and, when the peak has been detected, determining a focusposition on the basis of the peak and finishing focus position detectionprocessing.

According to the embodiment of the invention, the focus control stepincludes a step of judging, when blink detection information indicatingthat a person has blinked is inputted from the blink detecting unitafter the start of driving of a focus lens for acquisition of anevaluation value, whether a peak of an evaluation value has beendetected and, when the peak has not been detected, executing, afterconfirming that the blink is finished, acquisition of an evaluationvalue from a focus lens setting position before the person blinks.

According to the embodiment of the invention, the imaging apparatuscontrol method further includes a subject-distance calculating step ofcalculating, in a subject-distance calculating unit, a subject distanceon the basis of a size of a face included in the input image. The focuscontrol step includes a step of executing comparison of a subjectdistance based on an evaluation value corresponding to contrast and thesubject distance calculated on the basis of the size of the face and,when there is a difference equal to or larger than a threshold set inadvance between both the distances, executing evaluation valueacquisition processing based on the contrast again.

According to the embodiment of the invention, the subject-distancecalculating step includes a step of inputting subject information of atleast one of a race, a sex, an age, and a physique in subject distancecalculation processing based on a size of a face detected by a facedetecting unit and executing, on the basis of the subject informationinputted, subject distance calculation processing to which a referencevalue of a size of a face corresponding to the subject is applied.

According to the embodiment of the invention, the focus control stepincludes a step of repeatedly executing evaluation value acquisitionprocessing based on the contrast of the range finding area plural times,comparing plural result data acquired, and, when same evaluation dataare acquired, determining a focus position according to majorityprocessing for setting the evaluation value data as proper evaluationdata.

According to still another embodiment of the invention, there isprovided a computer program for causing an imaging apparatus to executeauto-focus control, the computer program including a focus control stepof setting, in a focus control unit, an image area including eyes, whichis included in an input image of the imaging apparatus, as a rangefinding area for calculation of a subject distance and acquiring anevaluation value based on contrast of the range finding area to detect afocus position and a blink detecting step of detecting, in a blinkdetecting unit, presence or absence of a blink on the basis of imageanalysis in the range finding area. The focus control step is a step ofinputting blink detection information in the blink detection unit,identifying evaluation value data in a blink period and a non-blinkperiod, and executing processing for detecting a focus position on thebasis of only an evaluation value in a period judged as the non-blinkperiod.

The computer program according to the embodiment of the invention is acomputer program that can be provided to, for example, a computer systemcapable of executing various program codes through a storage mediumprovided in a computer readable format, a communication medium,recording media such as a CD, an FD, and an MO, or a communicationmedium such as a network. By providing such a program in a computerreadable format, processing corresponding to the program is realized onthe computer system.

Other objects, characteristics, and advantages of the invention will beapparent through more detailed explanations based on embodiments of theinvention described later and attached drawings. In this specification,a system is a logical set of plural apparatuses and is not limited toapparatuses of various structures housed in an identical housing.

According to an embodiment of the invention, in the focus controlprocessing for setting an image area including eyes, which is includedin an input image in the imaging apparatus, as a range finding area forcalculation of a subject distance and acquiring an evaluation valuebased on contrast of the range finding area to detect a focus position,blink detection information is inputted, evaluation data in a blinkperiod and a non-blink period are identified, and processing fordetecting a focus position is executed on the basis of only anevaluation value in a period judged as the non-blink period. Thus, it ispossible to prevent occurrence of a focus error due to a contrast changebased on a blink.

According to an embodiment of the invention, even when blink detectionis not performed satisfactorily, for example, comparison of subjectdistance information based on a size of a face and a subject distancecalculated from an evaluation value is executed to discriminate whethercorrect evaluation value acquisition and evaluation value acquisitiondata acquired in plural times of searches are compared to acquirecorrect evaluation value data according to a decision by majority. Thus,even when blink detection is not performed satisfactorily, focus controlbased on an accurate evaluation value is realized.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows diagrams for explaining AF evaluation value calculation andan influence of a blink in auto-focus processing;

FIGS. 2A to 2C are diagrams for explaining an example of an externalstructure of an imaging apparatus according to an embodiment of theinvention;

FIG. 3 is a diagram for explaining an example of a hardwareconfiguration of the imaging apparatus according to the embodiment;

FIGS. 4A and 4B are diagrams for explaining an example of setting of arange finding area;

FIG. 5 is a diagram for explaining examples of lens driving and AFevaluation value measurement in focus control of the imaging apparatusaccording to the embodiment;

FIG. 6 is a flowchart for explaining an auto-focus control sequence ofthe imaging apparatus according to the embodiment;

FIG. 7 is a diagram for explaining subject-distance calculationprocessing based on a size of a face;

FIG. 8 is a diagram for explaining a structure and processing of aface-size-reference-value calculating unit;

FIG. 9 shows diagrams for explaining examples of a reference valuecalculation table applied to calculation in theface-size-reference-value calculating unit;

FIG. 10 is a diagram for explaining an example of the reference valuecalculation table applied to calculation in theface-size-reference-value calculating unit;

FIG. 11 is a diagram for explaining an example of the reference valuecalculation table applied to calculation in theface-size-reference-value calculating unit;

FIG. 12 is a flowchart for explaining an auto-focus control sequence ofthe imaging apparatus according to the embodiment;

FIG. 13 is a diagram for explaining processing to which majorityprocessing is applied;

FIG. 14 is a flowchart for explaining an auto-focus control sequence towhich the majority processing is applied;

FIG. 15 is a diagram for explaining an example of focus display; and

FIG. 16 is a block diagram for explaining processing and functions inthe imaging apparatus according to the embodiment.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Details of an imaging apparatus, an imaging apparatus control method,and a computer program according to an embodiment of the invention willbe hereinafter explained with reference to the accompanying drawings.

In the embodiment of the invention, a technique for making it possibleto perform quick and accurate auto-focus for a target subject isdisclosed. In the imaging apparatus according to the embodiment, as amethod of focus control, a method of judging a level of contrast ofimaging data acquired via a lens is used as a basis. The imagingapparatus sets a specific area including eyes of a face of a personincluded in a photographed image as a signal acquisition area (a spatialfrequency extraction area) for focus control, judges that the lens ismore in focus as contrast of this specific area is higher and that thelens is out of focus when the contrast is low, and drives the lens toincrease the contrast and adjust the focus.

Specifically, the imaging apparatus extracts a high-frequency componentof the specific area including the eyes, generates integrated data ofthe high-frequency component extracted, and judges a level of contraston the basis of the high-frequency component integrated data generated.In other words, the imaging apparatus calculates a high-frequencycomponent integrated value of the specific area to judge the level ofthe contrast and uses this high-frequency component integrated value asan evaluation value (an AF evaluation value). Auto-focus is realized bydriving a focus lens to maximize the evaluation value. To perform theauto-focus, it is necessary to drive the lens with the evaluation valueas a guideline. As a lens driving mechanism, for example, a voice coilmotor is used.

In this embodiment, presence or absence of a blink is detected,processing is changed on the basis of detection information, and anaccurate focus point (a focus position) is determined in this auto-focusprocessing.

First, a structure of the imaging apparatus according to this embodimentwill be explained with reference to the drawings. FIGS. 2A to 2C arediagrams showing an external appearance of an imaging apparatus 10. FIG.2A is a plan view of the imaging apparatus 10, FIG. 2B is a front viewof the imaging apparatus 10, and FIG. 2C is a rearview of the imagingapparatus 10. A lens portion of the plan view in FIG. 2A is shown as asectional view. The imaging apparatus 10 has a power supply switch 11,trigger means for setting image capturing timing, i.e., a release switch12 functioning as a shutter, a monitor 13 that displays an image (athrough image) photographed by the imaging apparatus, operationinformation, and the like, an imager 14 as an imaging device (a CCD),zoom buttons 15 for performing zoom control, operation buttons 16 forinputting various kinds of operation information, a viewfinder 17 forchecking the image (the through image) photographed by the imagingapparatus, a focus lens 18 driven in focus adjustment, a zoom lens 19driven in zoom adjustment, a mode dial 20 for setting a photographingmode, a focus lens motor (M1) 21 for driving the focus lens 18, and azoom lens motor (M2) 22 for driving the zoom lens 19.

A subject image is displayed on the viewfinder 17 and the monitor 13.The viewfinder 17 and the monitor 13 are constituted by, for example,LCDs. The subject image obtained through the lenses is displayed on theviewfinder 17 and the monitor 13 as a moving image. This moving image iscalled a through image. A user checks the viewfinder 17 or the monitor13, checks a target subject to be photographed, and presses the releaseswitch 12 as the shutter to execute recording processing for the image.

An internal structure of an imaging apparatus 100 according to thisembodiment will be explained with reference to FIG. 3. The imagingapparatus according to this embodiment is an imaging apparatus having anauto-focus function. Incident light through a focus lens 101 and a zoomlens 102 is inputted to an imaging device 103 such as a CCD (ChargeCoupled Device) and photoelectrically converted in the imaging device103. Photoelectrically converted data is inputted to an analog-signalprocessing unit 104, subjected to processing such as noise removal inthe analog-signal processing unit 104, and converted into a digitalsignal in an A/D conversion unit 105. The data converted into thedigital signal in the A/D conversion unit 105 is recorded in a recordingdevice 115 constituted by a flash memory or the like. The data isfurther displayed on a monitor 117 and a viewfinder (EVF) 116. An imageobtained through the lenses is displayed as a through image on themonitor 117 and the viewfinder (EVF) 116 regardless of whetherphotographing is performed.

An operation unit 118 is an operation unit including the release switch12, the zoom buttons 15, the operation buttons 16 for inputting variouskinds of operation information, and the mode dial 20 for setting aphotographing mode provided in a camera main body explained withreferenced to FIGS. 2A to 2C. A control unit 110 has a CPU and executescontrol of various kinds of processing executed by the imaging apparatusin accordance with programs stored in a memory (ROM) 120 and the like inadvance. A memory (EEPROM) 119 is a nonvolatile memory. Image data,various kinds of supplementary information, programs, and the like arestored in the memory 119. The memory (ROM) 120 stores programs,arithmetic operation parameters, and the like used by the control unit(the CPU) 110. A memory (RAM) 121 stores programs used in the controlunit (the CPU) 110, parameters that change in execution of the programsas appropriate, and the like. A gyro 111 detects an inclination, ashake, and the like of the imaging apparatus. Detection information isinputted to the control unit (the CPU) 110 and processing such as handshake prevention is executed.

A motor driver 112 drives a focus-lens driving motor 113 set inassociation with the focus lens 101 and a zoom-lens driving motor 114set in association with the zoom lens 102. A vertical driver 107 drivesthe imaging device (the CCD) 103. A timing generator 106 generates acontrol signal for processing timing of the imaging device 103 and theanalog-signal processing unit 104 and controls the processing timing ofthese processing units.

A face detecting unit 130 analyzes image data inputted through thelenses and detects a face and an area of eyes of a person in the imagedata. Detection information is sent to the control unit 110. The controlunit 110 specifies the face and the area of the eyes of the person as atarget subject on the basis of the detection information and measures adistance to the subject on the basis of this specified area.

In the imaging apparatus according to this embodiment, as describedabove, in focus control, the method of judging a level of contrast inimaging data acquired through the lenses is used as a basis. In thisfocus control using contrast identification processing, the imagingapparatus further detects presence or absence of a blink, changesprocessing on the basis of detection information, and determines anaccurate focus point (focus position).

In processing for judging a focus position based on contrast, theimaging apparatus calculates a high-frequency component integrated valueof a specific area and uses this high-frequency component integratedvalue as an evaluation value (an AF evaluation value). Auto-focus isrealized by driving a focus lens to maximize the evaluation value. Asspecific auto-focus control processing, there are a method of applyingservo to the focus lens such that the AF evaluation value keeps a peak(a hill-climbing method), a method of moving the focus lens to a focusposition obtained by calculating evaluation value data of a specificinterval in a specific area and calculating a maximum value ofevaluation values of the evaluation value data (a candidate range searchmethod), and the like.

The imaging apparatus according to this embodiment specifies a face andan area of eyes of a person as a target subject from image dataphotographed by the imaging apparatus and executes distance estimationbased on a specific area including the eyes. A specific processingconstitution for this processing will be hereinafter explained.Explanations will be made in the following order of items.

(1) Face and eyes recognition processing

(2) Blink detection and processing for coping with the blink

(3) Subject distance calculation processing based on a size of a face

(4) Processing based on a majority method

(1) Face and Eyes Recognition Processing

First, a method of specifying a face and an area of eyes of a personfrom image data acquired by the imaging apparatus will be explained. Asa technique for recognizing and tracking a face, various techniques havealready been disclosed. It is possible to apply these existingtechniques to the technique for recognizing and tracking a face. Thetechnique can be realized by matching of a template having luminancedistribution information of a face recorded therein to an actual imagedescribed in, for example, JP-A-2004-133637. First, plural kinds ofimages obtained by applying reduction processing to the actual image areprepared. A group of luminance distribution information templates of aface obtained when a person leans the face is prepared in advance.Matching of the images and the templates is subsequently performed. Thetemplates are templates inclined with respect to each of X, Y, and Zaxes of a face three-dimensional orthogonal coordinate system. An actualinclination of the face is judged according to matching with thetemplates.

When the matching of the reduced images with the templates issequentially performed while shifting the images on a two-dimensionalplane, if a certain area matches the templates, the area is a positionwhere the face is present. It is possible to calculate a size of theface from a reduction ratio of the actual image. It is possible tocalculate a rotation angle, a yaw, a pitch, and a roll angle around theorthogonal three axes from the templates used in the matching. An areaof the eyes is estimated from data of the face obtained in this way. Anarea of the eyes is specified from a luminance distribution of theestimated area. A range finding area, which is a specific area fordistance measurement, is set in an image area of the eyes calculated inthis way. An example of specific setting of a range finding area isshown in FIGS. 4A and 4B.

FIG. 4A is an example of a range finding area set in respective areas oftwo eyes from a face image facing forward and FIG. 4B is an example of arange finding area set in an area of one eye from a face image facingsideway.

The imaging apparatus executes, as a basis, control for acquiring animage of this range finding area through the lenses, judging a level ofcontrast by moving the focus lens, and setting a position where thecontrast is the highest, i.e., a position where an AF evaluation valueis high as a focus position. Moreover, the imaging apparatus accordingto this embodiment detects presence or absence of a blink, changesprocessing on the basis of detection information, and determines anaccurate focus point (a focus position).

(2) Blink Detection and Processing for Coping with the Blink

The imaging apparatus according to this embodiment judges whether theperson has blinked the eyes in the set range finding area during focuscontrol processing for judging a level of contrast by moving the focuslens. Processing for judging presence or absence of a blink is performedby monitoring color fluctuation in a position judged as eyes. In otherwords, the imaging apparatus executes analysis of an image area judgedas eyes and executes blink judgment processing for judging that theperson is blinking when a white area is reduced or the white area hasdisappeared.

In auto-focus processing, for example, the imaging apparatus executes,as a basis, processing for sequentially moving a focus lens 201 from aclose range side to an infinite side as shown in FIG. 5, measuring an AFevaluation value equivalent to a level of contrast in the range findingarea including the eyes at each moving point, and setting a peakposition of the AF evaluation value as a focus point (a focus position).

A sequence of the auto-focus processing including the blink detectionand the processing for coping with the blink according to thisembodiment will be explained. The imaging apparatus according to thisembodiment executes acquisition of detection data in a range findingarea including eyes and blink judgment and prevents defocus due to ablink by applying a processing method explained below to the auto-focusprocessing.

(Processing “a”) Processing Before Starting Evaluation Value Search

On the basis of half-press of a shutter, when a blink is detected duringexecution of preparation processing for an evaluation value search foracquisition of a contrast signal, i.e., processing for searching for anAF evaluation value corresponding to a measurement value of contrastcorresponding to movement of the focus lens, the imaging apparatus movesthe focus lens to a search start position, completes preparation forauto-focus, and stands by for finish of the blink. Thereafter, afterconfirming the finish of the blink, the imaging apparatus starts theevaluation value search.

(Processing “b”) Processing 1 after Starting Evaluation Value Search

When a blink is detected during the evaluation value search, if thedetection of the blink is before the evaluation value forms a peak, theimaging apparatus stands by at a point of the detection until the blinkis finished. Here, when there is a time difference “delay”: Td in thedetection of the blink of the eyes, the imaging apparatus returns by adistance of the movement of the lens in this time: Td and stands by atthis point and resumes the search from the point immediately after theblink is finished.

(Processing “c”) Processing 2 after Starting Evaluation Value Search

When there is a time difference (Delay) in acquisition of a luminancedifference evaluation value with respect to the blink detection, if itis possible to confirm that the delayed evaluation value forms a peakduring the standby for finish of the blink, the imaging apparatus judgesthis peak as a focus point and finishes the search.

(Processing “d”) Processing 3 after Starting Evaluation Value Search

When the blink is not finished even if the standby for finish of theblink is continued for a fixed time, the imaging apparatus judges thatthe person has closed the eyes, clears a search result obtained, andstarts a new search from that point.

A sequence of the auto-focus processing including the blink detectionand the processing for coping with the blink according to thisembodiment including the processing described above will be explainedwith reference to a flowchart shown in FIG. 6. The flowchart shown inFIG. 6 is a flowchart of processing executed under the control by thecontrol unit 110 of the imaging apparatus shown in FIG. 3. Thisprocessing is executed after an area of eyes of a person in an image isdetected in the face detecting unit 130 on the basis of an analysis ofan input image obtained through the lenses and an image area includingthe area of the eyes is set as a specific area (a range finding area)for AF evaluation value calculation.

First, in step S101, the control unit 110 moves the focus lens to asearch start position. This corresponds to the processing “a” describedabove. In other words, on the basis of shutter half-press, to start anevaluation value search for acquisition of a contrast signal as an AFevaluation, the control unit 110 moves the focus lens to the searchstart position, for example, a close range side limit.

In step S102, the control unit 110 judges whether a person is blinking.This processing is performed by detecting a change in a color in animage area including a position judged as eyes as described above. Inother words, the control unit 110 executes an analysis of the image areajudged as eyes, i.e., a specific area (a range finding area) and detectsa change in a ratio of a white area in this image area. Specifically,the control unit 110 judges that the person is blinking when the whitearea is reduced or the white area has disappeared.

When it is judged in step S102 that the person is blinking, the controlunit 110 returns to step S101. In other words, the control unit standsby in a state in which the focus lens is moved to the search startposition. When it is judged in step S102 that the person is not blinkingyet, the control unit 110 proceeds to step S103 and starts an evaluationvalue search. In other words, in step S104, the control unit 110 startsprocessing for moving the focus lens and acquiring an evaluation value.

The control unit 110 monitors presence or absence of a blink even duringthe evaluation value acquisition processing. When a blink is notdetected in step S105 and it is judged in step S106 that an evaluationvalue forms a peak, the control unit 110 judges that a point of peakformation is a focus position and finishes the processing. When a peakof the evaluation value is not detected in step S106, the control unit110 confirms that the search has reached an end point (e.g., an infiniteside limit) and finishes the processing.

On the other hand, during the execution of the search as the evaluationvalue acquisition processing, when a blink is detected in step S105, thecontrol unit 110 proceeds to step S108 and executes processing forreturning the lens by a distance of movement of the lens equivalent totemporal “delay” of the blink detection. This is equivalent to theprocessing “b” and is processing for returning by a distance of movementof the lens in the time of the detection delay: Td, standing by at thispoint, and, immediately after the blink is finished, resuming the searchfrom the point.

Subsequently, in step S109, the control unit 110 judges whether theevaluation value has formed a peak. This processing for judgingformation of a peak of the evaluation value is a measure taken whenthere is a delay in evaluation value detection and is equivalent to theprocessing “c”. When there is a time difference (Delay) in acquisitionof a luminance difference evaluation value with respect to the blinkdetection, if it is possible to confirm that the delayed evaluationvalue forms a peak during the standby for finish of the blink, thecontrol unit 110 judges this peak as a focus point and finishes thesearch (Yes in S109).

When it is difficult to confirm in step S109 that the evaluation valueforms a peak, the control unit 110 proceeds to step S110 and confirmsthat the blink is finished. On the basis of the confirmation, thecontrol unit 110 returns to step S104 and resumes the search. A positionof the lens in this case is calculated from the lens position set instep S108. The evaluation value data acquired by the processing is usedas it is.

When the control unit 110 proceeds to step S110, the blink is notfinished, stands by in step S111, and a fixed time set in advance haselapsed (Yes in step S112), the control unit 110 judges that the personclosed the eyes. In step S113, the control unit 110 clears searchresults to that point and starts a new search from the point. Thisprocessing is processing corresponding to the processing “d”.

In this way, in this embodiment, presence or absence of a blink isdetected before starting the search for acquisition of an AF evaluationvalue and during execution of the search. Before starting the search,the search is started after standing by for finish of the blink. Duringexecution of the search, a processing form is changed according todetection of a peak of an evaluation value. In this way, efficientacquisition of an AF evaluation value without waste of operations isrealized and occurrence of a focus error due to a blink is prevented.

(3) Subject Distance Calculation Processing Based on a Size of a Face

An example of processing also using subject distance calculationprocessing based on a size of a face as a measure at the time when blinkdetection is not accurately executed will be explained. It isconceivable that, when an area including eyes of a person as a subjectis set as a range finding area and a blink is detected on the basis of achange in an image in the area, i.e., an increase and a decrease of awhite area, the imaging apparatus fails in the blink detection. In sucha case, there is a concern that a focus moving position substantiallydeviates from a position where the lens should be focused. Processingfor comparing a distance of a focus position and a distance physicallycalculated from information on a size of a face and, when the distancesdeviate from each other by a fixed value or more, performing the searchagain to prevent shift of a focus will be hereinafter explained.

In this embodiment, a distance to a face is calculated according to asize of the face included in an image photographed by the imagingapparatus. This processing will be explained with reference to FIG. 7. Asubject position 301, a focus lens 302, and an imaging device 303 areshown in FIG. 7. A face of a person is present in the subject position301. A size of the face (the width of the face) is Wf.

If the actual size (Wf) of the face is known, from a basic physical lawof lenses, it is possible to calculate a distance to the face, i.e., asubject distance (Df), which is a distance (Df) from the focus lens 302to the subject position 301, according to the following equation.Df=Wref×(f/Wi)×(Ww/Wf)  (Equation 1.1)where Wref is a reference value of a size of a face of a person, Wi isthe width of an imaging device, f is a focal length, Wf is the number ofpixels (an imaging device detection value) of a size of the face of theperson in a photographed image, and Ww is the number of pixels (animaging device detection value) of a size of an image used for detectionof the face of the person.

It is possible to use a fixed value set in advance as the referencevalue of a size of a face of a person (Wref). It is possible to performprocessing with this face size reference value (Wref) set to a valueobtained by taking into account an individual difference, a differenceof race, a difference of age, a difference of sex, and the like.According to this processing, it is possible to realize more accuratedistance estimation.

This processing will be explained with reference to FIG. 8 andsubsequent figures. This processing is processing for setting the facesize reference value: Wref to an appropriate value according to a race,a sex, an age, and a physique corresponding to a subject and calculatingan accurate subject distance (Df) corresponding to the subject. For thisprocessing, reference values Wref corresponding to various races, sexes,ages, and physiques are calculated and used. For example, table data forcalculation of the reference values Wref corresponding to various races,sexes, ages, and physiques is held, race, sex, age, and physiqueinformation corresponding to a subject is acquired on the basis of animage analysis result or user input information, and a face sizereference value: Wref corresponding to the subject is calculated fromthe table on the basis of these kinds of acquired information.

According to an analysis of a face image included in an imagephotographed by the imaging apparatus, it is possible to estimate arace, a sex, an age, and a physique of a person having the face. Inother words, parts of the face are identified and matching with partsinformation corresponding to races, sexes, ages, and physiquesregistered in advance is executed to estimate a race, a sex, an age, anda physique of the subject. Alternatively, it is also possible that auser like a photographer inputs subject information concerning a race, asex, an age, and a physique and applies this input information to theanalysis.

In this way, the race, sex, age, and physique information of the subjectis acquired as image analysis or user input information and a properface size reference value: Wref corresponding to the subject iscalculated. An example of this processing will be explained withreference to FIG. 8.

As shown in FIG. 8, the imaging apparatus has aface-size-reference-value (Wref) calculating unit 310. Theface-size-reference-value (Wref) calculating unit 310 has areference-value-by-race calculation table 311, a reference-value-by-sexcalculation table 312, a reference-value-by-age calculation table 313, areference-value-by-physique calculation table 314, and a data processingunit 320.

An image analyzing unit 331 estimates, according to an analysis of aface image included in an image photographed by the imaging apparatus, arace, a sex, an age, and a physique of a person having the face. Inother words, the image analyzing unit 331 identifies parts of the face,executes matching with parts information corresponding to races, sexes,ages, and physiques registered in advance, estimates a race, a sex, anage, and a physique of the subject, and inputs information on theestimation to the face-size-reference-value (Wref) calculating unit 310.Alternatively, the user like the photographer inputs subject informationconcerning a race, a sex, an age, and a physique via the user input unit332 and inputs this input information to the face-size-reference-value(Wref) calculating unit 310.

The face-size-reference-value (Wref) calculating unit 310 calculates anoptimum reference value (Wref) corresponding to the subject by applyingthe respective tables to the calculation on the basis of the subjectinformation inputted via the image analyzing unit 331 or the user inputunit 332. As an actual output, a reference value rangeWref=(Wref+ΔWrefb) to (Wref−ΔWrefs) taking into account a certain degreeof variation may be calculated. The face-size-reference-value (Wref)calculating unit 310 outputs a result obtained by taking into accountestimated deviation to a large side as ΔWrefb and taking into accountestimated deviation to a small side as ΔWrefs.

Examples of a data structure of the tables will be explained withreference to FIGS. 9 to 11. In FIG. 9, (A) is a reference-value-by-racecalculation table and (B) is a reference-value by race and sexcalculation table. In FIG. 10, (C) is a reference-value by race, sex,and age calculation table. In FIG. 11, (D) is a reference-value by race,sex, age, and physique calculation table. In the explanation of theexample of the structure shown in FIG. 8, the separate tables for arace, a sex, an age, and a physique are set. However, rather thansetting the separate tables, it is possible to set tables in variousforms as shown in FIGS. 9 to 11.

For example, when it is possible to estimate or decide only a race onthe basis of the subject information inputted via the image analyzingunit 331 or the user input unit 332, the reference-value-by-racecalculation table shown in (A) in FIG. 9 is used. If it is difficult tojudge a race, “common” data is used.

When it is possible to estimate or decide a race and a sex on the basisof the subject information inputted via the image analyzing unit 331 orthe user input unit 332, the reference-value by race and sex table shownin (B) in FIG. 9 is used. If a person is an Asian and male, data in an Arow shown in (B) in FIG. 9 is used. On the other hand, for example, whenit is difficult to decide a race of a person but it is possible toestimate or decide a sex of the person as female, data in a B row shownin (B) in FIG. 9 indicating that a race is common and a sex is female isused.

Similarly, when it is possible to estimate or decide a race, a sex, andan age, the reference-value by race, sex, and age calculation tableshown in (C) in FIG. 10 is used. If it is known that a person is anAsian male and is twelve years and over, data in a C row shown in (C) inFIG. 10 only has to be used. When it is difficult to estimate an age dueto some reason, data in a D row shown in (C) in FIG. 10 only has to beused. Similarly, when it is possible to estimate or decide a race, asex, an age, and a physique, an optimum reference valueWref=(Wref+ΔWrefb) to (Wref−ΔWrefs) is calculated using thereference-value by race, sex, age, and physique calculation table shownin (D) in FIG. 11.

In this way, it is possible to acquire race, sex, age, and physiqueinformation of the subject as image analysis or user input informationand calculate a proper face size reference value: Wref corresponding tothe subject. It is possible to calculate a more accurate distance (Df)to the subject by applying the reference value: Wref calculated to thecalculation. In processing for applying the reference value: Wref andprocessing for calculation of the distance (Df) to the subject, it ispossible to apply any one of the width of the face and the length of theface to the calculation and it is possible to further use both the widthand the length. Moreover, an inclination of the face may be taken intoaccount.

Comparison of the distance (Df) to the subject calculated on the basisof the size of the face of the subject in this way and a focus positionobtained by detection of a peak of an AF evaluation value based oncontrast is executed. When deviation between the distance (Df) and thefocus position is larger than a threshold set in advance, the imagingapparatus judges that it is likely that there is an error in thedetection of the peak of the AF evaluation value and performs the searchagain. A sequence of this processing will be explained with reference toa flowchart shown in FIG. 12.

The processing indicated by the flowchart shown in FIG. 12 is executedunder the control by the control unit 110 of the imaging apparatus shownin FIG. 3. This processing is also executed after a face area and anarea of eyes of a person in an image are detected in the face detectingunit 130 on the basis of an analysis of an input image obtained throughthe lenses and an image area including the area of the eyes is set as aspecific area (a range finding area) for calculation of an AF evaluationvalue.

First, in step S201, the control unit 110 executes processing forsearching for an AF evaluation value. In other words, the control unit110 sequentially moves the focus lens from the close range side to theinfinite side and acquires an evaluation value corresponding to contrastof a specific area (a range finding area). In step S202, the controlunit 110 calculates a subject distance (Ds) at a point where anevaluation value forms a peak in this search processing. Moreover, instep S203, the control unit 110 calculates a distance (Df) to thesubject on the basis of the size of the face according to the processingexplained with reference to FIGS. 7 to 11.

Subsequently, in step S204, the control unit 110 compares the subjectdistance (Ds) calculated on the basis of the peak of the AF evaluationvalue and the subject distanced (Df) calculated on the basis of the sizeof the face and judges whether a difference between the subject distance(Ds) and the subject distance (Df) is within a threshold set in advance.When it is judged that the difference is within the threshold set inadvance, in step S205, the control unit 110 judges that the evaluationvalue search is accurately executed and sets the peak position obtainedon the basis of the evaluation value search as a focus position.

On the other hand, when the control unit 110 compares the subjectdistance (Ds) calculated on the basis of the peak of the AF evaluationvalue and the subject distance (Df) calculated on the basis of the sizeof the face and it is judged that a difference between the subjectdistance (Ds) and the subject distance (Df) is larger than the thresholdset in advance in step S204, in step S206, the control unit 110 judgesthat the evaluation value search is not accurately executed, returns tostep S201, and performs the evaluation value search again.

According to this processing, even when the control unit 110 fails inblink detection in the evaluation value search and a focus point basedon an accurate evaluation value is not obtained, it is possible todetect occurrence of an error on the basis of a subject distance basedon the size of the face and it is possible to prevent wrong setting of aposition of the focus lens.

(4) Processing Based on a Majority Method

As in (3) above, an example of processing for judging an accurate peakposition and setting the focus lens at a correct focus positionaccording to a decision by majority of results of searches performedplural times will be explained as a measure at the time when blinkdetection is not accurately executed during execution of the search.

For example, when a white balance deviates or when an exposure is notcorrect, it may be impossible to correctly perform “blink detection”according to the processing for detecting a blink, i.e., detecting achange in a white area of an area including eyes. A method forpreventing the problem is this majority method.

Specifically, the imaging apparatus executes the following processing.

When it is difficult to secure accuracy of blink detection, the imagingapparatus repeatedly executes a search in the same AF range twice.

When results of the searches repeatedly executed twice indicate the samefocus position, the imaging apparatus trusts the results.

When results of the searches repeatedly executed twice are different,the imaging apparatus carries out a third search in the same range. Whena position in a result of the third search is present in the results ofthe first or the second search, the position in the result of the thirdsearch is set as a focus position.

When all focus positions in the results of the searches repeatedlyexecuted three times do not coincide with one another, the imagingapparatus judges that it is difficult to focus on the subject andoutputs a warning or further repeats the search until a resultoverlapping the search results in the past is obtained.

Examples of the first to the third searches for an AF evaluation valuewill be explained with reference to FIG. 13. In all of the examples, anidentical range finding area of an identical subject, i.e., an imagearea including eyes is set as a range finding area and AF evaluationvalues depending on contrast data are acquired. Positions of peaks arepositions where contrast is the highest and the AF evaluation values arethe highest and are points estimated as focus points.

However, since a position of a peak P1 in the first search and aposition of a peak P2 in the second search are different, it is assumedthat a measurement error has occurred in any one of the searches. Insuch a case, the third search is executed and comparison of a peak P3obtained by the third search, the peak P1 of the first search, and thepeak P2 of the second search is executed. The peak P3 substantiallycoincides with the peak P2. In such a case, the imaging apparatus judgesthat the peaks P2 and P3 are peaks obtained as a result of a correctsearch and sets a position of the peaks as a focus position.

In this way, in this example of the processing, the imaging apparatusdetermines a focus point according to the decision by majority based onthe results of the searches performed plural times and determines aposition for setting the focus lens. A sequence for executing thisprocessing will be explained with reference to a flowchart shown in FIG.14. The processing indicated by the flowchart shown in FIG. 14 isexecuted under the control by the control unit 110 of the imagingapparatus shown in FIG. 3. This processing is also executed after a facearea and an area of eyes of a person in an image are detected in theface detecting unit 130 on the basis of an analysis of an input imageobtained through the lenses and an image area including the area of theeyes is set as a specific area (a range finding area) for calculation ofan AF evaluation value.

First, in step S301, the control unit 110 executes processing forsearching for an AF evaluation value. In other words, the control unit110 sequentially moves the focus lens from the close range side to theinfinite side and acquires an evaluation value corresponding to contrastof a specific area (a range finding area). Subsequently, in step S302,the control unit 110 judges reliability of blink detection executed inthe first search processing. As described above, when a white balance ofan image acquired in the imaging apparatus deviates or when an exposureis not correct, it is assumed that the reliability of the blinkdetection has fallen. Therefore, the control unit 110 of the imagingapparatus judges the white balance of the acquired image and accuracy ofadjustment of the exposure and judges reliability of the blink detectionon the basis of information on this judgment.

When it is judged in step S302 that the reliability of the blinkdetection is high, the control unit 110 proceeds to step S312, judgesthat a peak position in an AF evaluation value in the first searchprocessing is a focus position, set the focus lens in the focusposition, and finishes the processing.

When it is judged in step S302 that the reliability of the blinkdetection is low, the control unit 110 proceeds to step S303 andexecutes a second search. The control unit 110 sequentially moves thefocus lens from the close range side to the infinite side and acquiresan evaluation value corresponding to contrast of the specific area (therange finding area) again.

Subsequently, in step S304, the control unit 110 executes comparison ofthe AF evaluation value obtained by the first search and an AFevaluation value obtained by the second search. When both the AFevaluation values are substantially identical results, the control unit110 judges that both the searches are correctly executed and proceeds tostep S312. The control unit 110 judges that a peak position in the AFevaluation values in the first or the second search is a focus positionby applying the AF evaluation values to the judgment, sets the focuslens in the focus position, and finishes the processing.

When it is judged in step S304 that the AF evaluation value obtained bythe first search and the AF evaluation value obtained by the secondsearch are different, the control unit 110 proceeds to step S305 andexecutes a third search. The control unit 110 sequentially moves thefocus lens from the close range side to the infinite side and acquiresan evaluation value corresponding to contrast of the specific area (therange finding area) again.

Subsequently, in step S306, the control unit 110 executes comparison ofan AF evaluation value obtained by the third search and the AFevaluation values obtained by the first and the second searches. Whenthe AF evaluation value obtained by the third search and the searchresult of the first or the second search are the same, the control unit110 proceeds to step S311. The control unit 110 judges that the AFevaluation value obtained by the third search is a correct evaluationvalue and proceeds to step S312. The control unit 110 judges that a peakposition in the AF evaluation value of the third search is a focusposition by applying the AF evaluation value to the judgment, sets thefocus position in the focus position, and finishes the processing.

When it is judged in step S306 that the AF evaluation value obtained bythe third search is different from both the AF evaluation valuesobtained by the first and the second searches, the control unit 110judges in step S307 whether the search should be retried. When thesearch should not be retried, the control unit 110 proceeds to stepS308, outputs a warning or a message indicating that the control unit110 has failed in focus processing and finishes the processing. When itis judged in step S307 that the search should be retried, the controlunit 110 proceeds to step S313, replaces the third search with the firstsearch, and repeatedly executes the processing in step S303 and thesubsequent steps, i.e., the second search processing and the subsequentprocessing. In the processing in step S307 for judging whether thesearch should be retired, the control unit 110 may apply information setin the apparatus in advance to the processing or may cause the user tojudge whether the search should be retried and execute the search on thebasis of an input of the user.

In this way, in this example of the processing, the imaging apparatusjudges reliability of a peak position of an evaluation value accordingto a decision by majority based on results of searches performed pluraltimes and determines a final focus point, i.e., a setting position ofthe focus lens. Thus, even when a correct AF evaluation value is notobtained because of an error of blink detection, it is possible toprevent the focus lens from being set in a wrong focus position.

When a position of the focus lens is determined and the imagingapparatus succeeds in the focusing according to the processing describedabove, the imaging apparatus presents a focus frame indicating that thefocusing is successful in a display image on a monitor of the imagingapparatus and notifies the user of the success in the focusing. Forexample, the imaging apparatus performs focus display on a specificface. The focus display is identification information indicatingcompletion of the focusing presented in an image displayed on themonitor or the viewfinder. The user is capable of surely photographing asubject by checking this focus display and pressing a shutter tophotograph the subject.

An example of the focus display is shown in FIG. 15. The example shownin FIG. 15 is an example in which the focus display is performed in animage displayed on a monitor of a camera as the imaging apparatus. Forexample, when the imaging apparatus executes the auto-focus processingaccording to the AF evaluation value calculation on the basis of an areaincluding eyes of a face 421 shown in FIG. 15 and succeeds in focusing,a focus frame 431 is set and displayed on the face 421. Moreover, whenit is judged that a face 422 and a face 423 are also in an allowablefocus depth set in advance at this focus point, the imaging apparatusdisplays focus frames 432 and 433 on the faces. The user is capable ofsurely photographing a subject by checking this focus display, pressinga shutter, and photographing the subject.

Lastly, a functional structure for performing the processing executed inthe imaging apparatus according to this embodiment will be explainedwith reference to FIG. 16. The processing is executed by applying thehardware configuration explained with reference to FIG. 3 to theprocessing and in accordance with mainly a program executed under thecontrol by the control unit 110. FIG. 16 is a block diagram for chieflyexplaining functions applied to this processing in executing theprocessing.

Image information 500 acquired in the imaging apparatus is inputted to aface detecting unit 502 via the imaging device, the digital-signalprocessing unit, and the like explained with reference to FIG. 3. Theface detecting unit 502 analyzes the image information 500 and detects aface and an area of an eye of a person in an image in the same manner asdescribed above.

Image information including face detection information detected by theface detecting unit 502 is outputted to a range-finding-area settingunit 503, an image analyzing unit 504, a face-size-reference-value[Wref] calculating unit 505, and a face-estimated-distance [Df]calculating unit 506. The range-finding-area setting unit 503 sets anarea including the eyes of the face detected by the face detecting unit502 as a specific area for calculation of an AF evaluation, i.e., arange finding area.

Range finding area information including the eyes of the person set bythe range-finding-area setting unit 503 is inputted to a focus controlunit 507. The focus control unit 507 outputs a driving command to afocus-lens driving unit 510. The focus lens is moved in an operationrange of the focus lens. The focus control unit 507 acquires an AFevaluation value from contrast information generated by acontrast-signal generating unit 508 at each moving point. In otherwords, the focus control unit 507 sets the image area including the eyesincluded in the input image 500 inputted in the imaging apparatus as arange finding area for calculation of a subject distance, acquires anevaluation value based on contrast of the range finding area, anddetects a focus position.

In this AF evaluation value acquisition processing, the focus controlunit 507 inputs blink detection information detected by a blinkdetecting unit 509 and changes processing according to whether a blinkis detected. In other words, the focus control unit 507 inputs blinkdetection information in the blink detecting unit 509, identifiesevaluation value data in a blink period and a non-blink period, andexecutes processing for detecting a focus position on the basis of onlyan evaluation value in a period judged as non-blink period.Specifically, the focus control unit 507 executes the processingexplained with reference to the flowchart in FIG. 6. A display controlunit 511 performs processing to display the focus frame explained withreference to FIG. 15 on a subject focused by this focus control.

For example, before the start of driving of the focus lens foracquisition of an evaluation value, when detection informationindicating that a person is blinking is inputted from the blinkdetecting unit 509, the focus control unit 507 stands by for finish ofthe blink and, after it is confirmed that the blink is finished, startsdriving of the focus lens for acquisition of an evaluation value. Afterthe start of driving of the focus lens for acquisition of an evaluationvalue, when blink detection information indicating that the person hasblinked in inputted from the blink detecting unit 509, the focus controlunit 507 stops the driving of the focus lens to suspend the acquisitionof an evaluation value, returns the focus lens to a focus lens settingposition before the person blinks, and resumes the acquisition of anevaluation value.

However, when blink detection information indicating that the person hasblinked is inputted from the blink detecting unit 509, the focus controlunit 507 judges whether a peak of an evaluation value has already beendetected. When the peak has been detected, the focus control unit 507determines a focus position on the basis of the peak and finishes focusposition detection processing.

Moreover, when the processing explained with reference to the flowchartin FIG. 12, i.e., calculation of a distance based on a size of a face isalso executed, the image analyzing unit 504 executes the image analysisprocessing explained with reference to FIG. 7. In other words, the imageanalyzing unit 504 estimates, according to an analysis of a face imageincluded in an image photographed by the imaging apparatus, a race, asex, an age, and a physique of a person having the face. The imageanalyzing unit 504 identifies parts of the face, executes matching ofthe parts with parts information corresponding to races, sexes, ages,and physiques registered in advance, estimates a race, a sex, an age,and a physique of a subject, and inputs information on the estimation tothe face-size-reference-value [Wref] calculating unit 505. These kindsof subject information may be inputted by the user via the user inputunit 501.

The face-size-reference-value [Wref] calculating unit 504 calculates, onthe basis of the subject information inputted via the image analyzingunit 503 or the user input unit 501, an optimum reference value (Wref)corresponding to the subject by applying the respective tables to thecalculation. In calculation processing, as explained with reference toFIGS. 8 to 11, a reference value Wref corresponding to the subject iscalculated with reference to the tables.

The face-estimated-distance [Df] calculating unit 506 calculates asubject distance Df by applying the face size reference value (Wref) tothe calculation. A basic equation for calculation of the subjectdistance is the equation explained above, i.e.,Df=Wref×(f/Wi)×(Ww/Wf)  (Equation 1.1)where Wref is a reference value of a size of a face of a person, Wi isthe width of an imaging device, f is a focal length, Wf is the number ofpixels (an imaging device detection value) of a size of the face of theperson in a photographed image, and Ww is the number of pixels (animaging device detection value) of a size of an image used for detectionof the face of the person.

Subject distance information calculated on the basis of the size of theface is outputted to the focus control unit 507. The focus control unit507 compares the subject distance (Ds) calculated on the basis of thepeak of the AF evaluation value and the subject distance (Df) calculatedon the basis of the size of the face. When it is judged that adifference between the subject distance (Ds) and the subject distance(Df) is larger than a threshold set in advance, the focus control unit507 judges that evaluation value search is not accurately executed andperforms the evaluation value search again. This processing isequivalent to the processing explained with reference to the flowchartin FIG. 12.

When the majority processing explained with reference to FIGS. 13 and 14is executed, the focus control unit 507 executes a search to which anidentical range finding area is applied to repeat the AF evaluationacquisition and compares plural result data acquired. When sameevaluation value data are acquired, the focus control unit 507determines a correct peak and determines a focus position and a settingposition of the focus lens according to the majority processing forsetting the evaluation value data as proper evaluation data.

The invention has been explained in detail with reference to thespecific embodiment. However, it is obvious that those skilled in theart can perform correction and substitution of the embodiment withoutdeparting from the spirit of the invention. The invention has beendisclosed in a form of illustration and should not be interpretedlimitedly. To judge the gist of the invention, the appended claimsshould be taken into account.

It is possible to execute the series of processing explained in thisspecification with hardware, software, or a combination of the hardwareand the software. When the processing by the software is executed, it ispossible to install a program having a processing sequence recordedtherein in a memory in a computer built in dedicated hardware andexecute the program. Alternatively, it is possible to install theprogram in a general-purpose computer capable of executing various kindsof processing and execute the program.

For example, it is possible to record the program in a hard disk or aROM (Read Only Memory) as a recording medium in advance. Alternatively,it is possible to temporarily or permanently store (record) the programin a removable recording medium such as a flexible disk, a CD-ROM(Compact Disc Read Only Memory), an MO (Magneto Optical) disk, a DVD(Digital Versatile Disk), a magnetic disk, or a semiconductor memory. Itis possible to provide such a removable recording medium as so-calledpackage software.

Other than installing the program in a computer from the removablerecording medium, it is possible to transfer the program to the computerby radio or transfer the program to the computer via a network such as aLAN (Local Area Network) or the Internet by wire from a download site.The computer can receive the program transferred in that way and installthe program in a recording medium such as a hard disk built therein.

The various kinds of processing described in this specification are notonly executed in time series in accordance with the above descriptionbut may be executed in parallel or individually according to aprocessing ability of an apparatus that executes the processing or whennecessary. In this specification, the system is a logical set of pluralapparatuses and is not limited to apparatuses of various structureshoused in an identical housing.

As explained above, according to the embodiment of the invention, in thefocus control processing for setting an image area including eyes, whichis included in an input image in the imaging apparatus, as a rangefinding area for calculation of a subject distance and acquiring anevaluation value based on contrast of the range finding area to detect afocus position, blink detection information is inputted, evaluation datain a blink period and a non-blink period are identified, and processingfor detecting a focus position is executed on the basis of only anevaluation value in a period judged as the non-blink period. Thus, it ispossible to prevent occurrence of a focus error due to a contrast changebased on a blink.

According to the embodiment of the invention, even when blink detectionis not performed satisfactorily, for example, comparison of subjectdistance information based on a size of a face and a subject distancecalculated from an evaluation value is executed to discriminate whethercorrect evaluation value acquisition is executed and evaluation valueacquisition data obtained in plural times of searches are compared toacquire correct evaluation value data according to a decision bymajority. Thus, even when blink detection is not performedsatisfactorily, focus control based on an accurate evaluation value isrealized.

It should be understood by those skilled in the art that variousmodifications, combinations, sub-combinations, and alterations may occurdepending on design requirements and other factors insofar as they arewithin the scope of the appended claims or the equivalents thereof.

1. An imaging apparatus comprising: an imaging device to capture aninput image; a focus processing unit to acquire an evaluation valuebased on contrast of the input image to detect a focus position; a blinkdetecting unit to detect presence or absence of a blink of an imagesubject included in the input image on the basis of image analysis ofthe input image; and a control unit to move a focus lens to a searchevaluation value start position prior to acquisition of the evaluationvalue, wherein, upon determination by the blink detecting unit that theimage subject is not currently blinking, the focus processing unitexecutes processing to acquire the evaluation value in accordance withthe movement of the focus lens from the search evaluation start positionto detect the focus position during a period that is set in accordancewith a detection result of the blink detecting unit indicating that theimage subject has not blinked after movement of the focus lens from theevaluation value start position.
 2. The imaging apparatus according toclaim 1, wherein upon detection by the blink detecting unit that theimage subject is blinking prior to start of driving of a focus lens, thefocus processing unit waits until detection by the blink detecting unitthat the blink is finished to start driving of the focus lens foracquisition of the evaluation value.
 3. The imaging apparatus accordingto claim 1, wherein upon detection by the blink detecting unit that theimage subject blinked after a start of driving of a focus lens foracquisition of the evaluation value, the focus processing unit suspendsacquisition of the evaluation value and returns the focus lens to afocus lens setting before detection of the blink.
 4. The imagingapparatus according to claim 3, wherein the return of the focus lens tothe focus lens setting before detection of the blink takes into accounta time difference between blink detection processing and evaluationcalculation processing.
 5. The imaging apparatus according to claim 1,wherein upon determination by the blink detecting unit that the imagesubject blinked after a start of driving a focus lens for acquisition ofthe evaluation value, the focus processing unit determines whether apeak of the evaluation value has been detected, and upon detection ofthe peak, the focus processing unit determines a focus positionaccording to the detected peak.
 6. The imaging apparatus according toclaim 1, wherein upon determination by the blink detecting unit that theimage subject blinked after a start of driving of a focus lens foracquisition of the evaluation value, the focus processing unitdetermines whether a peak of an evaluation value has been detected, andupon failure to detect the peak, the focus processing unit, uponindication by the blink detecting unit that the blink is finished,executes acquisition of the evaluation value from a focus lens settingposition before the image subject blinked.
 7. The imaging apparatusaccording to claim 1, further comprising: a subject-distance calculatingunit to calculate a first subject distance according to a size of a faceof the image subject and a second subject distance according to anevaluation value corresponding to the contrast, wherein the focusprocessing unit determines a difference between the first subjectdistance with the second subject distance, and upon determination thatthe difference is equal to or larger than a predetermined threshold, thefocus processing unit repeats execution of evaluation value acquisitionprocessing.
 8. The imaging apparatus according to claim 7, wherein thesubject-distance calculating unit receives subject information of atleast one of a race, a sex, an age, and a physique associated with theimage subject, and the size of the face of the image subject isestimated according to the subject information.
 9. The imaging apparatusaccording to claim 8, further comprising: an image analyzing unit toestimate the subject information.
 10. The imaging apparatus according toclaim 8, further comprising: a user interface to receive the subjectinformation via user input.
 11. The imaging apparatus according to claim1, wherein the focus processing unit repeats acquisition of theevaluation value upon determination that a peak of the evaluation valuehas not been detected and a position of a focus lens has not reached anend point.
 12. A method for processing an input image in an imagingapparatus, the method comprising: acquiring an evaluation value based oncontrast of the input image to detect a focus position; detectingpresence or absence of a blink of an image subject included in the inputimage on the basis of image analysis of the input image; moving a focuslens to a search evaluation value start position prior to acquisition ofthe evaluation value; and acquiring, upon determination that the imagesubject is not currently blinking, the evaluation value in accordancewith movement of the focus lens from the evaluation value start positionto detect the focus position during a period that is set in accordancewith a detection result of the blink detecting unit indicating that theimage subject has not blinked after movement of the focus lens from theevaluation value start position.
 13. A non-transitory computer readablestorage medium having instructions stored thereon, which when executedby a processor in an imaging apparatus causes the processor to: acquirean evaluation value based on contrast of an input image to detect afocus position; detect presence or absence of a blink of an imagesubject included in the input image on the basis of image analysis ofthe input image; move a focus lens to a search evaluation value startposition prior to acquisition of the evaluation value; and acquire, upondetermination that the image subject is not currently blinking, theevaluation value in accordance with movement of the focus lens from theevaluation value start position to detect the focus position during aperiod that is set in accordance with a detection result of the blinkdetecting unit indicating that the image subject has not blinked aftermovement of the focus lens from the evaluation value start position.